package chapter8.section3;

import chapter6.section3.Account;

//程序8-3：记录客户业务请求信息的Task类
public class Task {
    public static String DEPOSIT = "deposit";// 存款
    public static String WITHDRAW = "withdraw";// 取款

    // 该数组主要用于在排队机中随机不同的存取款事务
    public static String[] tranTypes = {"deposit", "withdraw"};
    private int num;// 流水号
    private Account account;// 每笔业务涉及的账户
    private int amount; // 每笔业务的金额
    private String tranType; // 业务发生类型

    public Task(int num, Account account, int amount, String tranType) {
        super();
        this.num = num;
        this.account = account;
        this.amount = amount;
        this.tranType = tranType;
    }

    public Account getAccount() {
        return account;
    }

    public void setAccount(Account account) {
        this.account = account;
    }

    public int getAmount() {
        return amount;
    }

    public void setAmount(int amount) {
        this.amount = amount;
    }

    public String getTranType() {
        return tranType;
    }

    public void setTranType(String tranType) {
        this.tranType = tranType;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    @Override
    public String toString() {
        return "Transaction [num=" + num + ", account=" + account + ", amount=" + amount + ", tranType=" + tranType + "]";
    }
}
